{extend name="common/base" /}
<!--title-->
{block name="titlekeyword"}
<title>{$content}</title>

{/block}
<!--代码主要内容-->
{block name="main"}
<h6>内容</h6>

<h6>代码</h6>
<pre>
	&lt;script language="javascript"&gt;
	window.onload = function () {  //先加载页面内容 再加载js
		function Dog() {
		}
        /*<b>在类外 增加方法shout</b>*/
		Dog.prototype.shout = function () {  //写在类之外
			window.alert('小狗');
		}

		var dog1 = new Dog();
		dog1.shout();

		var dog2 = new Dog();
		dog2.shout();


	}
&lt;/script&gt;

	 </pre> {/block}
<!--底部js 在这里是js的实际代码区-->
{block name="footjs"}
<script language="javascript">
	window.onload = function () {  //先加载页面内容 再加载js
		function Dog() {
		}
        /*在类外 增加方法shout*/
		Dog.prototype.shout = function () {  //写在类之外
			window.alert('小狗');
		}

		var dog1 = new Dog();
		dog1.shout();

		var dog2 = new Dog();
		dog2.shout();


	}
</script> {/block}